package com.yiyuwanglu.basecore.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.yiyuwanglu.basecore.dao.mongodb.MongoDBBaseDao;
import com.yiyuwanglu.basecore.service.IStatisticsService;

@Service(value = "statisiticsService")
public class StatisticsServiceImpl implements IStatisticsService {

	@Resource(name = "mongoDBBaseDao")
	MongoDBBaseDao mongoDBBaseDao;
	
	@Override
	public void baseDataInsert(DBObject data) {
		DBCollection statisitics = mongoDBBaseDao.getCollection("statistics");
		// 添加到数据库
		mongoDBBaseDao.collectionInsert(statisitics, data);
	}
	
	@Override
	public void wapDataInsert(DBObject data) {
		DBCollection statisitics = mongoDBBaseDao.getCollection("wap");
		// 添加到数据库
		mongoDBBaseDao.collectionInsert(statisitics, data);
	}
	
	@Override
	public void insert(Map<String, Object> data) {
		// 添加到数据库
		mongoDBBaseDao.add(data, "statisitics");
	}
	
}
